#include "mystdio.h"
#include "mystdio.c"
#include <stdio.h>
#include <stdlib.h>
#define TEXT "test.txt"

int main()
{

  MY_FILE* fp = my_fopen(TEXT, "w");
  if(fp == NULL)
  {
    perror("MY_FILE:");
    exit(-1);
  }

  const char* str = "hello my_fwrite\n";
  my_fwrite(str, strlen(str) + 1, 1, fp);
  //int cnt = 5;

  //char buffer[1024];
  //while(cnt)
  //{

  //  snprintf(buffer, sizeof(buffer), "%s:%d\n", str, cnt--);
  //}

  //my_fwrite(buffer, sizeof(buffer), 1, fp);
  my_fclose(fp);
  return 0;
}
